<template>
  <h2>计数器组件</h2>
  <button @click="num--">-</button>
  <span>{{ num }}</span>
  <button @click="num++">+</button>
  <button @click="() => (num = 0)">归零</button>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const num = ref(0)
</script>

<style lang="scss" scoped>
button {
  margin: 10px;
}
</style>
